<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>日志管理</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Data Tables -->
<link href="css/plugins/dataTables/dataTables.bootstrap.css"
	rel="stylesheet">
<link href="css/plugins/dataTables/dataTables.responsive.css"
	rel="stylesheet">
<link href="css/plugins/dataTables/dataTables.tableTools.min.css"
	rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/css.css" />

<style type="text/css">
button {
	border-radius: 15px;
	font-size: 18px;
	color: #fff;
	background-color: #47a4e1;
	width: 100px;
	height: 30px;
}
</style>

</head>
<body style="background-color: white">
	<div class="pageTop" style="position: relative; height: 50px">
		<div class="page">
			<img src="img/coin02.png" /><span><a href="main.do">首页</a>&nbsp;-&nbsp;-</span>&nbsp;<a
				href="logmanage.do">日志管理</a>
		</div>
	</div>
	<div class="row">
		<div class="col-lg-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
					<button class="userbtn" style="position: absolute; left: 50px"
						onclick="window.location.href='log_add.do'">新增日志</button>
					&nbsp;&nbsp;&nbsp;

				</div>
				<div class="ibox-content">
					<table class="table table-striped table-bordered table-hover "
						id="editable">
						<thead>
							<tr>

								<th style="text-align: center">编号</th>
								<th style="text-align: center">机构名称</th>
								<th style="text-align: center">机构类型</th>
								<th style="text-align: center">经办人</th>
								<th style="text-align: center">联系人</th>
								<th style="text-align: center">日志日期</th>
								<th style="text-align: center">日志等级</th>
								<th style="text-align: center">操作</th>

							</tr>
						</thead>
						<tbody>
							<c:forEach items="${diarylist}" var="d">
								<tr class="gradeX" role="row">
									<td>${d.id }</td>
									<td>${d.organization.name }</td>
									<td><c:if test="${d.organization.type==1 }">政府</c:if> <c:if
											test="${d.organization.type==2 }">学校</c:if> <c:if
											test="${d.organization.type==3 }">企业</c:if> <c:if
											test="${d.organization.type==4 }">其他</c:if></td>
									<td>${d.organization.contact.ename }</td>
									<td>${d.organization.contact.name }</td>
									<td><fmt:formatDate value="${d.diarydate }"
											pattern="yyyy-MM-dd" /></td>
									<td><c:if test="${d.diarylevel==1 }">一般日志</c:if> <c:if
											test="${d.diarylevel==2 }">重要日志</c:if> <c:if
											test="${d.diarylevel==3 }">无效日志</c:if></td>
									<td><a href="log_detail.do?id=${d.id }"><img
											class="operation" src="img/view.png"></a></td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
	<!-- Mainly scripts -->
	<script src="js/jquery-2.1.1.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
	<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

	<!-- Data Tables -->
	<script src="js/plugins/dataTables/jquery.dataTables.js"></script>
	<script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
	<script src="js/plugins/dataTables/dataTables.responsive.js"></script>


	<!-- Custom and plugin javascript -->
	<script src="js/inspinia.js"></script>


	<!-- Page-Level Scripts -->
	<script>
		$(document)
				.ready(
						function() {
							$('.dataTables-example')
									.dataTable(
											{
												responsive : true,
												"dom" : 'T<"clear">lfrtip',
												"tableTools" : {
													"sSwfPath" : "js/plugins/dataTables/swf/copy_csv_xls_pdf.swf"
												}
											});

							/* Init DataTables */
							var oTable = $('#editable').dataTable();

							/* Apply the jEditable handlers to the table */
							oTable
									.$('td')
									.editable(
											'../example_ajax.php',
											{
												"callback" : function(sValue, y) {
													var aPos = oTable
															.fnGetPosition(this);
													oTable.fnUpdate(sValue,
															aPos[0], aPos[1]);
												},
												"submitdata" : function(value,
														settings) {
													return {
														"row_id" : this.parentNode
																.getAttribute('id'),
														"column" : oTable
																.fnGetPosition(this)[2]
													};
												},
												"width" : "90%",
												"height" : "100%"
											});

						});

		function fnClickAddRow() {
			$('#editable').dataTable()
					.fnAddData(
							[ "Custom row", "New row", "New row", "New row",
									"New row" ]);

		}
	</script>

</body>
</html>